<?php
//error_reporting (E_ERROR | E_WARNING | E_PARSE);
error_reporting (E_WARNING|E_PARSE|E_ERROR);
if(get_magic_quotes_gpc())
{
	ini_set("magic_quotes_gpc",1);
}
include "connect.php";
class db_query
{
	var $query_number=0;
	var $linkID;
	var $sql;
	function connect()
	{
		global $serverName,$DbUser,$DbPassword,$DbName;
		if($this->linkID = mysql_connect($serverName,$DbUser,$DbPassword))
		{
			mysql_select_db($DbName,$this->linkID);
			return true;
		}
		else
		{
			return false;
		}
	}
	function query($sql)
	{
		$this->query_number++;
		$this->sql = $sql;
		$result = mysql_query($sql,$this->linkID);
		if(mysql_error())
		{
			return false;
		}
		else
		{
			return $result;
		}
	}
	function fetchArray($result)
	{
		return mysql_fetch_array($result);
	}
	function close()
	{
		mysql_close($this->linkID);
	}
	function queryNumbers()
	{
		return $this->query_number;
	}
	function numrows($res)
	{
		return mysql_num_rows($res);
	}
	function affectedrows()
	{
		return mysql_affected_rows($this->linkID);
	}
	function insertid()
	{
		return mysql_insert_id($this->linkID);
	}
	function result($res,$row,$field)
	{
		return mysql_result($res,$row,$field);
	}
	function source()
	{
		return $this->sql;
	}
	function numFields($res)
	{
		return mysql_num_fields($res);
	}
}

			
